<?php 
	include CHEMIN_MODELE.'get_annee_scolaire.php';
	if($_POST['date'] != get_annee_scolaire(date('d/m/Y')))
	{
		$bdd = PDO2::getInstance();
		
		$annees = preg_split("- -", $_POST['date']);
		
	 	foreach($bdd->query('SELECT '.ID_ADC.', '.THEME_ADC.', '.TITRE_ADC.', DATE_FORMAT('.DATE_ADC.',\'%e/%m/%Y\') as DateA, '.LOGIN_PROF_ADC.', '.COMMENTAIRE_ADC.' FROM action_archive WHERE DateA BETWEEN \''.$annees[0].'-09-01\' AND \''.$annees[2].'-06-30\'') as $a)
	 	{
	 		$action = new ActionDeCommunication($a[ID_ADC]);
	 		$action->set_id_theme($a[THEME_ADC]);
	 		$action->set_titre($a[TITRE_ADC]);
	 		$action->set_date_deroulement($a[DATE_ADC]);
	 		$action->set_commentaire($a[COMMENTAIRE_ADC]);
	 		$action->set_login_enseignant($a[LOGIN_PROF_ADC]);
	 		
	 		
	 		$table_action[] = $action;
	 	}
	 	
	 	include CHEMIN_VUE.'v_visionner.php';
	}
	else
		header('location: index.php?module=actionComm&action=visionnerToutADC');
	 	
?>